package com.sky.controller.admin;


import com.sky.result.Result;
import com.sky.service.ReportService;
import com.sky.service.WorkSpaceService;
import com.sky.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/admin/workspace")
@Api(tags = "工作台相关接口")
public class WorkSpaceController {
    @Autowired
    ReportService reportService;
    @Autowired
    WorkSpaceService workSpaceService;


    @ApiOperation("查询今日运营数据")
    @GetMapping("/businessData")
    Result<BusinessDataVO> getBusinessData(){
        BusinessDataVO businessDataVO = reportService.getBusinessData();
        log.info("查询今日运营数据:{}", businessDataVO);
        return Result.success(businessDataVO);
    }

    @ApiOperation("查询订单管理数据")
    @GetMapping("/overviewOrders")
    Result<OrderOverViewVO> getOverviewOrders(){
        OrderOverViewVO orderOverView = workSpaceService.getOrderOverView();
        log.info("查询订单管理数据{}", orderOverView);
        return Result.success(orderOverView);
    }

    @ApiOperation("查询套餐总览")
    @GetMapping("/overviewSetmeals")
    Result<SetmealOverViewVO> getoverviewSetmeals(){
        SetmealOverViewVO setmealOverView = workSpaceService.getSetmealOverView();
        log.info("查询套餐总览{}",setmealOverView);
        return Result.success(setmealOverView);
    }

    @ApiOperation("查询菜品总览")
    @GetMapping("/overviewDishes")
    Result<DishOverViewVO> getOverviewDishes(){
        DishOverViewVO dishOverView = workSpaceService.getDishOverView();
        log.info("查询菜品总览{}",dishOverView);
        return Result.success(dishOverView);
    }

}
